"use strict";jQuery.fn.getAttributes=function(){var a={};if(!this.length){return this}jQuery.each(this[0].attributes,function(c,b){a[b.name]=b.value});return a};jQuery.fn.getDatas=function(){var a={},b="data-vp-";if(!this.length){return this}jQuery.each(this[0].attributes,function(d,c){if(c.name.substring(0,b.length)==b){a[c.name.substring(b.length)]=c.value}});return a};jQuery.fn.exists=function(){return this.length!==0};if(!String.prototype.trimChar){String.prototype.trimChar=function(a){return this.replace(new RegExp("^"+a+"+|"+a+"+$","g"),"")}}if(!String.prototype.format){String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return typeof a[c]!="undefined"?a[c]:b})}}if(!String.prototype.replaceAll){String.prototype.replaceAll=function(c,d,a){var e,b=-1,f;if((e=this.toString())&&typeof c==="string"){f=a===true?c.toLowerCase():undefined;while((b=(f!==undefined?e.toLowerCase().indexOf(f,b>=0?b+d.length:0):e.indexOf(c,b>=0?b+d.length:0)))!==-1){e=e.substring(0,b).concat(d).concat(e.substring(b+c.length))}}return e}}jQuery.fn.validationVal=function(){var d=this,e="",a=d.prop("tagName"),b;if((d.length>1&&d.attr("type")!="radio")||d.attr("multiple")){e=[]}var c=e;d.each(function(f){var g=jQuery(this);switch(a){case"SELECT":if(g.has("[multiple]")){e=g.val()}else{e=g.val()}break;case"INPUT":switch(d.attr("type")){case"text":e=g.val();break;case"radio":b=g.prop("checked");if(typeof b!=="undefined"&&b!==false){e=g.val()}break;case"checkbox":b=g.prop("checked");if(d.length>1){if(typeof b!=="undefined"&&b!==false){e.push(g.val())}}else{e=null;if(typeof b!=="undefined"&&b!==false){e=g.val()}}break}break;case"TEXTAREA":e=g.val();break;default:e=g.val();break}});if(e===null){e=c}return e};jQuery.fn.vp_slideUp=function(b){var a=this;a.each(function(d){var c=jQuery(this);if(!c.hasClass("vp-hide")){c.slideUp("fast",function(){jQuery(this).addClass("vp-hide").slideDown(0,b)})}})};jQuery.fn.vp_slideDown=function(b){var a=this;a.each(function(d){var c=jQuery(this);if(c.hasClass("vp-hide")){c.slideUp(0,function(){jQuery(this).removeClass("vp-hide").slideDown("fast",b)})}})};jQuery.fn.vp_fadeOut=function(b){var a=this;if(!a.hasClass("vp-hide")){a.fadeOut("fast",function(){jQuery(this).addClass("vp-hide").fadeIn(0,b)})}};jQuery.fn.vp_fadeIn=function(b){var a=this;if(a.hasClass("vp-hide")){a.fadeOut(0,function(){jQuery(this).removeClass("vp-hide").fadeIn("fast",b)})}};jQuery.fn.vp_toggle=function(b){var a=this;if(a.hasClass("vp-hide")){a.slideUp(0,function(){jQuery(this).removeClass("vp-hide").slideDown("fast",b)})}else{a.slideUp("fast",function(){jQuery(this).addClass("vp-hide").slideDown(0,b)})}};var vp={};vp.isNumber=function(a){return !isNaN(parseFloat(a))&&isFinite(a)};vp.parseOpt=function(b){var d,c,a,g,f={};for(var e=0;e<b.length;e++){if(b[e]=="("){d=e}if(b[e]==")"){c=e;a=b.substring(d+1,c);g=a.split(":");f[g[0]]=vp.isNumber(g[1])?parseFloat(g[1]):g[1]}}return f};vp.wp_ext2type=function(c){var d={image:["jpg","jpeg","bmp","gif","png"],audio:["aac","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mp2","mp3","ogg","oga","ram","wav","wma"],video:["asf","avi","divx","dv","flv","m4v","mkv","mov","mp4","mpeg","mpg","mpv","ogm","ogv","qt","rm","vob","wmv"],document:["doc","docx","docm","dotm","odt","pages","pdf","rtf","wp","wpd"],spreadsheet:["numbers","ods","xls","xlsx","xlsm","xlsb"],interactive:["swf","key","ppt","pptx","pptm","pps","ppsx","ppsm","sldx","sldm","odp"],text:["asc","csv","tsv","txt"],archive:["bz2","cab","dmg","gz","rar","sea","sit","sqx","tar","tgz","zip","7z"],code:["css","htm","html","php","js"]};var a="default";for(var b in d){if(d.hasOwnProperty(b)){if(jQuery.inArray(c,d[b])!==-1){a=b;break}}}return a};vp.get_url_extension=function(b){var c=new RegExp(/(.*)[\/\\]([^\/\\]+)\.(\w+)/i);var a=c.exec(b);if(a){if(typeof a[3]!="undefined"){return a[3]}}return""};vp.jqid=function(a){return"#"+a.replace(/([:\.\[\]])/g,"\\$1")};vp.jqidwild=function(a){a=a.replace(/([:\.\[\]])/g,"\\$1");a="[id*="+a+"]";return a};vp.jqname=function(a){return'[name="'+a+'"]'};vp.jqnamewild=function(a){return'[name*="'+a+'"]'};vp.thejqid=function(b,a){if(a==="option"){return vp.jqid(b)}if(a==="metabox"){return vp.jqidwild(b)}return b};vp.thejqname=function(b,a){if(a==="option"){return vp.jqname(b)}if(a==="metabox"){return vp.jqnamewild(b)}return b};vp.validateAlphabet=function(a,c){if(c===""||jQuery.isArray(c)||jQuery.inArray(a,vp_wp.alphabet_validatable)==-1){return true}var b=new RegExp(/^[A-Z\s]+$/i);return b.test(c)};vp.validateAlphaNumeric=function(a,c){if(c===""||jQuery.isArray(c)||jQuery.inArray(a,vp_wp.alphanumeric_validatable)==-1){return true}var b=new RegExp(/^[A-Z0-9]+$/i);return b.test(c)};vp.validateNumeric=function(a,c){if(c===""||jQuery.isArray(c)||jQuery.inArray(a,vp_wp.numeric_validatable)==-1){return true}var b=new RegExp(/^[-+]?[0-9]*\.?[0-9]+$/);return b.test(c)};vp.validateEmail=function(a,c){if(c===""||jQuery.isArray(c)||jQuery.inArray(a,vp_wp.email_validatable)==-1){return true}var b=new RegExp(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i);return b.test(c)};vp.validateURL=function(a,c){if(c===""||jQuery.isArray(c)||jQuery.inArray(a,vp_wp.url_validatable)==-1){return true}var b=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/i);return b.test(c)};vp.validateMaxLength=function(a,b,c){if(jQuery.inArray(a,vp_wp.maxlength_validatable)!=-1){return true}return(b.length<=c)?true:false};vp.validateMinLength=function(a,b,c){if(jQuery.inArray(a,vp_wp.minlength_validatable)!=-1){return true}return(b.length>=c)?true:false};vp.validateRequired=function(a,b){if(jQuery.isArray(b)&&jQuery.isEmptyObject(b)){return false}return(b)?true:false};vp.fields_validation_loop=function(o){var t='<li class="validation-msg vp-error"></li>',f=0;for(var s=0;s<o.length;s++){var a=o[s],u=jQuery(vp.jqid(a.name)),l=u.parents(".vp-meta-group").exists()?u.parents(".vp-meta-group"):u.parents(".vp-section");if(u.length<=0){continue}if(u.hasClass("vp-dep-inactive")||(l.exists()&&l.hasClass("vp-dep-inactive"))){continue}var q=u.children("div.field").children(".validation-msgs").children("ul"),b=jQuery('[name="'+a.name+'"]'),w=b.validationVal(),c=a.type,h=a.rules.split("|");a.nError=0;for(var r=0;r<h.length;r++){var d=h[r],g=d.indexOf("["),e=d.indexOf("]"),k=(g>=0)?d.substring(0,g):d,v="",p;switch(k){case"alphabet":if(!vp.validateAlphabet(c,w)){v=vp_wp.val_msg.alphabet.format()}break;case"alphanumeric":if(!vp.validateAlphaNumeric(c,w)){v=vp_wp.val_msg.alphanumeric.format()}break;case"numeric":if(!vp.validateNumeric(c,w)){v=vp_wp.val_msg.numeric.format()}break;case"email":if(!vp.validateEmail(c,w)){v=vp_wp.val_msg.email.format()}break;case"url":if(!vp.validateURL(c,w)){v=vp_wp.val_msg.url.format()}break;case"maxlength":p=d.substring(g+1,e);if(!vp.validateMaxLength(c,w,p)){v=vp_wp.val_msg.maxlength.format(p)}break;case"minlength":p=d.substring(g+1,e);if(!vp.validateMinLength(c,w,p)){v=vp_wp.val_msg.minlength.format(p)}break;case"maxselected":p=d.substring(g+1,e);if(!vp.validateMaxLength(c,w,p)){v=vp_wp.val_msg.maxselected.format(p)}break;case"minselected":p=d.substring(g+1,e);if(!vp.validateMinLength(c,w,p)){v=vp_wp.val_msg.minselected.format(p)}break;case"required":if(!vp.validateRequired(c,w)){v=vp_wp.val_msg.required.format()}break}if(v!==""){a.nError+=1;var m=jQuery(t);m.html(v);m.appendTo(q)}}if(a.nError>0){f+=1;u.addClass("vp-error")}}return f};vp.custom_check_radio_event=function(b,a){jQuery(b).delegate(a,"click",function(f){f.preventDefault();var d=jQuery(this).find("input"),c=d.attr("type");if(c=="radio"){jQuery(this).parent().parent().find("input").each(function(e){jQuery(this).removeClass("checked");d.prop("checked",false)});d.prop("checked",true).change()}else{if(c=="checkbox"){if(d.is(":checked")){d.prop("checked",false)}else{d.prop("checked",true)}d.trigger("change")}}});jQuery(b).delegate(a,"change",function(d){d.preventDefault();var c=jQuery(this).find("input");if(c.is(":checked")){c.addClass("checked")}else{c.removeClass("checked")}})};vp.binding_action=function(a,k,c,m){var d=jQuery(vp.jqid(k.source)),h=jQuery('[name="'+k.source+'"]'),l=[];for(var g=0;g<a.length;g++){var b=jQuery(vp.thejqname(a[g],m)).validationVal();if(jQuery.isArray(b)&&b.length==0){b=null}l.push(b)}var f={action:"vp_ajax_wrapper",func:c,params:l};var e=d.find(".vp-js-bind-loader"),j=d.find(".input");if(k.type=="vp-html"){e.vp_fadeIn()}else{j.vp_fadeOut(function(){e.vp_fadeIn()})}jQuery.post(ajaxurl,f,function(i){e.vp_fadeOut(function(){j.vp_fadeIn()});if(i.status){var n;switch(k.type){case"vp-select":case"vp-multiselect":h=jQuery('[name="'+k.source+'"]');if(i.data!==null){n=i.data instanceof Array?i.data:[i.data];h.val(n).change()}break;case"vp-checkbox":if(i.data!==null){n=i.data instanceof Array?i.data:[i.data];h.prop("checked",false).change();jQuery.each(n,function(o,p){h.filter('[value="'+p+'"]').prop("checked",true).change()})}break;case"vp-toggle":if(i.data!==null){if(i.data){h.prop("checked",true).change()}else{h.prop("checked",false).change()}}break;case"vp-checkimage":if(i.data!==null){n=i.data instanceof Array?i.data:[i.data];h.prop("checked",false).change();jQuery.each(n,function(o,p){h.filter('[value="'+p+'"]').prop("checked",true).change()})}vp.init_tipsy();break;case"vp-radiobutton":if(i.data!==null){n=i.data instanceof Array?i.data:[i.data];h.prop("checked",false).change();jQuery.each(n,function(o,p){h.filter('[value="'+p+'"]').prop("checked",true).change()})}break;case"vp-radioimage":if(i.data!==null){n=i.data instanceof Array?i.data:[i.data];h.prop("checked",false).change();jQuery.each(n,function(o,p){h.filter('[value="'+p+'"]').prop("checked",true).change()})}vp.init_tipsy();break;case"vp-html":if(i.data!==null){jQuery(vp.jqid(k.source+"_dom")).html(i.data);jQuery(vp.jqname(k.source)).val(i.data)}break;default:h=jQuery(vp.jqname(k.source));h.val(i.data)}jQuery('[name="'+k.source+'"]:first').keypress().keyup().change().blur()}},"JSON")};vp.binding_event=function(a,h,f,c,g,j){var e=["vp-select","vp-checkbox","vp-checkimage","vp-radiobutton","vp-radioimage","vp-multiselect","vp-toggle","vp-upload"],i=["vp-textbox","vp-slider","vp-color","vp-date"],b=vp.thejqname(a[h],j),d=jQuery(vp.thejqid(a[h],j)).attr("data-vp-type");if(jQuery.inArray(d,e)!==-1){jQuery(g).delegate(b,"change",function(){vp.binding_action(a,f,c,j)})}else{if(jQuery.inArray(d,i)!==-1){jQuery(b).typing({stop:function(l,k){vp.binding_action(a,f,c,j)},delay:400})}else{jQuery(g).delegate(b,"change",function(){vp.binding_action(a,f,c,j)})}}};vp.items_binding_action=function(a,j,b,l){var c=jQuery(vp.jqid(j.source)),g=jQuery('[name="'+j.source+'"]'),k=[];for(var f=0;f<a.length;f++){k.push(jQuery(vp.thejqname(a[f],l)).validationVal())}var e={action:"vp_ajax_wrapper",func:b,params:k};var d=c.find(".vp-js-bind-loader"),h=c.find(".input");h.vp_fadeOut(function(){d.vp_fadeIn()});jQuery.post(ajaxurl,e,function(i){d.vp_fadeOut(function(){h.vp_fadeIn()});if(i.status){var m;switch(j.type){case"vp-select":case"vp-multiselect":m=jQuery('[name="'+j.source+'"]');m.empty();m.append(jQuery("<option></option>"));i.data!==null&&jQuery.each(i.data,function(n,o){m.append(jQuery("<option></option>").attr("value",o.value).text(o.label))});break;case"vp-checkbox":m=h;m.empty();m=jQuery(vp.jqid(j.source)).find(".input");i.data!==null&&jQuery.each(i.data,function(n,o){m.append(jQuery('<label><input class="vp-input" type="checkbox" name="'+j.source+'" value="'+o.value+'"><span></span>'+o.label+"</label>"))});break;case"vp-checkimage":m=h;m.empty();m=jQuery(vp.jqid(j.source)).find(".input");i.data!==null&&jQuery.each(i.data,function(n,o){m.append(jQuery('<label><input class="vp-input" type="checkbox" name="'+j.source+'" value="'+o.value+'"><img src="'+o.img+'" alt="'+o.label+'" class="vp-js-tipsy image-item" style="" original-title="'+o.value+'"></label>'))});vp.init_tipsy();break;case"vp-radiobutton":m=h;m.empty();m=jQuery(vp.jqid(j.source)).find(".input");i.data!==null&&jQuery.each(i.data,function(n,o){m.append(jQuery('<label><input class="vp-input" type="radio" name="'+j.source+'" value="'+o.value+'"><span></span>'+o.label+"</label>"))});break;case"vp-radioimage":m=h;m.empty();m=jQuery(vp.jqid(j.source)).find(".input");i.data!==null&&jQuery.each(i.data,function(n,o){m.append(jQuery('<label><input class="vp-input" type="radio" name="'+j.source+'" value="'+o.value+'"><img src="'+o.img+'" alt="'+o.label+'" class="vp-js-tipsy image-item" style="" original-title="'+o.value+'"></label>'))});vp.init_tipsy();break}jQuery('[name="'+j.source+'"]:first').change().blur()}},"JSON")};vp.items_binding_event=function(a,h,f,c,g,j){var e=["vp-select","vp-checkbox","vp-checkimage","vp-radiobutton","vp-radioimage","vp-multiselect","vp-toggle","vp-upload"],i=["vp-textbox","vp-slider","vp-color","vp-date"],b=vp.thejqname(a[h],j),d=jQuery(vp.thejqid(a[h],j)).attr("data-vp-type");if(jQuery.inArray(d,e)!==-1){jQuery(g).delegate(b,"change",function(){vp.items_binding_action(a,f,c,j)})}else{if(jQuery.inArray(d,i)!==-1){jQuery(b).typing({stop:function(l,k){vp.items_binding_action(a,f,c,j)},delay:400})}else{jQuery(g).delegate(b,"change",function(){vp.binding_action(a,f,c,j)})}}};vp.dependency_action=function(a,h,b){var c=jQuery(vp.jqid(h.source)),g=jQuery('[name="'+h.source+'"]'),j=[],f=[];for(var e=0;e<a.length;e++){f.push(jQuery(vp.jqid(a[e])));j.push(jQuery('[name="'+a[e]+'"]').validationVal())}var d={action:"vp_ajax_wrapper",func:b,params:j};jQuery.each(f,function(i,l){var k=l.find(".vp-js-bind-loader");k.vp_fadeIn()});jQuery.post(ajaxurl,d,function(i){jQuery.each(f,function(k,m){var l=m.find(".vp-js-bind-loader");l.vp_fadeOut()});if(i.status){if(i.data){c.removeClass("vp-dep-inactive");c.vp_fadeIn()}else{c.addClass("vp-dep-inactive");c.vp_fadeOut()}}},"JSON")};vp.dependency_event=function(a,h,f,c,g){var e=["vp-select","vp-checkbox","vp-checkimage","vp-radiobutton","vp-radioimage","vp-multiselect","vp-toggle","vp-upload"],i=["vp-textbox","vp-slider","vp-color","vp-date"],b=vp.thejqname(a[h],"option"),d=jQuery(vp.thejqid(a[h],"option")).attr("data-vp-type");if(jQuery.inArray(d,e)!==-1){jQuery(g).delegate(b,"change",function(){vp.dependency_action(a,f,c)})}else{if(jQuery.inArray(d,i)!==-1){jQuery(b).typing({stop:function(k,j){vp.dependency_action(a,f,c)},delay:400})}else{jQuery(g).delegate(b,"change",function(){vp.binding_action(a,f,c,thecase)})}}};function theValidate(b,a,e){var c=jQuery(b),d=c.val();if(d===""){return}if(!vp.validateNumeric("vp-textbox",d)){c.val(a.min);e.slider("value",a.min)}if(d>a.max){c.val(a.max);e.slider("value",a.max)}else{if(d<a.min){c.val(a.min);e.slider("value",a.min)}else{e.slider("value",c.val())}}}vp.init_slider=function(a){if(jQuery.fn.slider){a.each(function(c,d){var e=jQuery(this),b=jQuery(this).getDatas();b=vp.parseOpt(b.opt);b.range="min";b.slide=function(f,g){e.prev(".slideinput").val(g.value);e.prev(".slideinput").trigger("keypress");e.prev(".slideinput").trigger("keyup")};e.slider(b);e.prev(".slideinput").keypress(function(g){var f=(typeof g.which=="number")?g.which:g.keyCode;if(g.altKey||g.ctrlKey||g.shiftKey){return true}if(jQuery.inArray(f,[45,46,8,0])!=-1||(f>=48&&f<=57)){return true}return false}).blur(function(f){theValidate(this,b,e);e.prev(".slideinput").keypress().keyup()})})}};vp.upload_callback=function(){};if(vp_wp.use_new_media_upload){var _orig_send_attachment=wp.media.editor.send.attachment,_orig_send_link=wp.media.editor.send.link,_orig_send_to_editor=window.send_to_editor;vp.upload_callback=function(c){var b=jQuery(this),d=b.parent(".buttons").prev("input"),a=b.parent(".buttons").siblings(".image").find("img");wp.media.editor.send.attachment=function(e,f){d.val(f.url);d.trigger("change");if(f.type==="image"){a.attr("src",f.url)}else{a.attr("src",f.icon)}wp.media.editor.send.attachment=_orig_send_attachment;window.send_to_editor=_orig_send_to_editor};window.send_to_editor=function(e){if(e!==""){var f=get_url_info(e);d.val(f.imgurl);d.trigger("change");a.attr("src",f.iconurl)}window.send_to_editor=_orig_send_to_editor;wp.media.editor.send.attachment=_orig_send_attachment};wp.media.editor.open(b);return false}}else{var _orig_send_to_editor=window.send_to_editor;vp.upload_callback=function(c){var a=true,d=jQuery(this).parent(".buttons").prev("input"),b=jQuery(this).parent(".buttons").siblings(".image").find("img");tb_show("Upload Image","media-upload.php?&post_id=0&referer=vafpress&TB_iframe=true");window.send_to_editor=function(e){if(e!==""){var f=get_url_info(e);d.val(f.imgurl);d.trigger("change");b.attr("src",f.iconurl)}window.send_to_editor=_orig_send_to_editor;tb_remove()};return false}}function get_url_info(c){var e,d,a,f,b=jQuery(c);if(b.prop("tagName")=="A"){a=jQuery(c).attr("href");e=vp.get_url_extension(a);d=vp.wp_ext2type(e);f=a;if(d!=="image"){f=vp_wp.wp_include_url+"images/crystal/"+d+".png"}}else{if(b.prop("tagName")=="IMG"){a=jQuery(c).attr("src");f=a}}return{imgurl:a,iconurl:f}}vp.remove_upload_callback=function(c){var b=jQuery(this),d=b.parent(".buttons").prev("input"),a=b.parent(".buttons").siblings(".image").find("img");d.val("");a.attr("src","")};jQuery(document).on("click",".vp-js-upload",vp.upload_callback);jQuery(document).on("click",".vp-js-remove-upload",vp.remove_upload_callback);vp.init_colorpicker=function(a){if(jQuery.fn.colorpicker){if(a.length<=0){return}a.each(function(){var c=jQuery(this),b=jQuery(this).getDatas();b=vp.parseOpt(b.opt);c.colorpicker({format:b.format}).on("changeColor",function(e){var d;if(b.format=="hex"){d=e.color.toHex()}else{if(b.format=="rgba"){d=e.color.toRGB();d="rgba("+d.r+","+d.g+","+d.b+","+d.a+")"}else{if(b.format=="rgb"){d=e.color.toRGB();d="rgb("+d.r+","+d.g+","+d.b+")"}}}c.prev("label").find("span").css("background-color",d)}).on("blur",function(d){c.prev("label").find("span").css("background-color",c.val());c.keypress().keyup()})})}};vp.init_datepicker=function(a){if(jQuery.fn.datepicker){if(a.length<=0){return}a.each(function(){var b=jQuery(this).getDatas();b=vp.parseOpt(b.opt);b.onSelect=function(){jQuery(this).trigger("keypress");jQuery(this).trigger("keyup");jQuery(this).trigger("blur")};jQuery(this).datepicker(b);jQuery(this).datepicker("setDate",b.value)})}};vp.init_controls=function(a){vp.init_datepicker(a.find(".vp-js-datepicker"));vp.init_fontawesome_chooser(a.find(".vp-js-fontawesome"));vp.init_select2(a.find(".vp-js-select2"));vp.init_sorter(a.find(".vp-js-sorter"));vp.init_colorpicker(a.find(".vp-js-colorpicker"));vp.init_slider(a.find(".vp-js-slider"));vp.init_ace_editor(a.find(".vp-js-codeeditor"));vp.init_wpeditor(a.find(".vp-js-wpeditor"))};vp.init_fontawesome_chooser=function(a){if(jQuery.fn.select2){if(a.length<=0){return}var c=function b(d){return'<span class="fontawesome"><i class="fa '+d.id+'"></i>'+d.text+"</span>"};a.select2({formatResult:c,formatSelection:c,escapeMarkup:function(d){return d},allowClear:true,placeholder:vp_wp.ctrl_msg.fac_placeholder})}};vp.init_select2=function(a){if(jQuery.fn.select2){if(a.length<=0){return}a.select2({allowClear:true,placeholder:vp_wp.ctrl_msg.select2_placeholder})}};vp.init_sorter=function(a){if(jQuery.fn.select2Sortable){if(a.length<=0){return}a.each(function(d,e){var c=jQuery(e),b=c.getDatas();b=vp.parseOpt(b.opt);c.select2(b).select2Sortable({bindOrder:"sortableStop"})})}};vp.init_tipsy=function(){if(jQuery.fn.tipsy){jQuery(".vp-js-tipsy.description").tipsy({live:true,gravity:"e"});jQuery(".vp-js-tipsy.slideinput").tipsy({live:true,trigger:"focus"});jQuery(".vp-js-tipsy.image-item").tipsy({live:true})}};vp.init_tipsy();vp.init_ace_editor=function(a){if(window.ace!=="undefined"){if(a.length<=0){return}a.each(function(){var d=ace.edit(jQuery(this).get(0));var b=jQuery(this).prev();var c=jQuery(this).getDatas();c=vp.parseOpt(c.opt);d.setTheme("ace/theme/"+c.theme);if(c.mode){d.getSession().setMode("ace/mode/"+c.mode)}d.getSession().setUseWrapMode(true);d.setShowPrintMargin(false);d.getSession().setValue(b.val());d.getSession().on("change",function(){b.val(d.getSession().getValue())});b.on("change",function(){d.getSession().setValue(b.val())})})}};if(typeof window.KIA_metabox!=="undefined"){KIA_metabox.mediaButtons()}vp.init_wpeditor=function(a){if(typeof window.KIA_metabox!=="undefined"){if(a.length<=0){return}KIA_metabox.runTinyMCE(a)}};vp.tinyMCE_save=function(){if(typeof window.tinyMCE!=="undefined"){tinyMCE.triggerSave(false,true)}};